Skip to content

[SPARK-XXXXX][PYTHON] Standardize PySpark row count mismatch error class to use RESULT_ROWS_MISMATCH#57204

Open
Alwaysgaurav1 wants to merge 4 commits into
apache:masterfrom
Alwaysgaurav1:pyspark-udf-error-standardization
Open

[SPARK-XXXXX][PYTHON] Standardize PySpark row count mismatch error class to use RESULT_ROWS_MISMATCH#57204
Alwaysgaurav1 wants to merge 4 commits into
apache:masterfrom
Alwaysgaurav1:pyspark-udf-error-standardization

Conversation

@Alwaysgaurav1

Copy link
Copy Markdown

What changes were proposed in this pull request?

This PR resolves a TODO in python/pyspark/worker.py to standardize row count mismatch error reporting by using the unified RESULT_ROWS_MISMATCH error class instead of the legacy SCHEMA_MISMATCH_FOR_PANDAS_UDF class.

Why are the changes needed?

Previously, PySpark raised a custom SCHEMA_MISMATCH_FOR_PANDAS_UDF error class during UDF row count mismatches. Standardizing this error class to RESULT_ROWS_MISMATCH makes error codes and message patterns uniform across PySpark.

Does this PR introduce any user-facing change?

Yes, the error class raised on a Pandas/Arrow UDF row count mismatch changes from SCHEMA_MISMATCH_FOR_PANDAS_UDF to RESULT_ROWS_MISMATCH.

How was this patch tested?

  1. Ran unit tests targeting Pandas UDF execution:
python/run-tests.py --python-executables venv/bin/python --testnames pyspark.sql.tests.pandas.test_pandas_udf

Result: Passed successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant